﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

#nullable disable

namespace CzJ_VoteSys.Models.Database
{
    [Index(nameof(UserId), nameof(ParticipationId), Name = "idx_VoteRecords_UserID_ParticipationID")]
    public partial class VoteRecord
    {
        [Key]
        [Column("VoteRecordID")]
        public int VoteRecordId { get; set; }
        [Column("UserID")]
        public int UserId { get; set; }
        [Column("ParticipationID")]
        public int ParticipationId { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime VoteTime { get; set; }
        public int VoteCount { get; set; }

        [ForeignKey(nameof(ParticipationId))]
        [InverseProperty("VoteRecords")]
        public virtual Participation Participation { get; set; }
        [ForeignKey(nameof(UserId))]
        [InverseProperty("VoteRecords")]
        public virtual User User { get; set; }
    }
}
